<form method="POST" action="index.php?app=system&ctl=admin_crontab&act=save" class="tableform" id="crontab_form">
  <div class="division">
    <table cellspacing="0" cellpadding="0" width="100%">
      <tbody>
    <tr>
      <th>
        <label>定时任务ID:</label>
      </th>
      <td>
        <{$cron['id']}>
      </td>
    </tr>
    <tr>
      <th>
        <label><t>定时器类型</t>:</label>
      </th>
      <td>
        <{$cron['type']}>
      </td>
    </tr>
    <tr>
      <th>
        <label><t>最后执行时间</t>:</label>
      </th>
      <td>
        <{$cron['last']}>
      </td>
    </tr>
    <tr>
      <th>
        <label>描述:</label>
      </th>
      <td>
        <{$cron['description']}>
      </td>
    </tr>
    <tr>
      <th>
        <em class="red">*</em>
        <label>规则:</label>
      </th>
      <td>
        <{input name="schedule" type="text" vtype="required" value="{$cron['schedule']}"}>
      </td>
    </tr>
    <tr>
      <th>
        <label>是否启用:</label>
      </th>
      <td>
        <select name="enabled" class="x-select">
          <option <{if $cron['enabled'] == 'true'}> selected <{/if}> value="true">启用</option>
          <option <{if $cron['enabled'] == 'false'}> selected <{/if}> value="false">禁用</option>
        </select>
        <input type="hidden" name="id" value="<{$cron['id']}>" />
      </td>
    </tr>
      </tbody>
    </table>
    <div class="table-action">
      <{button type="button" label=$___desktop="保存"|t:'desktop' id="crontab_submit"}>
    </div>
  </div>
</form>

<script type="text/javascript">


(function(){
    var _form = $('crontab_form');
    var btn =$('crontab_submit');
    var finder = finderGroup['<{$env.get._finder.finder_id}>'];
    
    _form.store('target',{
        onSuccess:function(response){
            var hash_res_obj = JSON.decode(response);
        
            if (hash_res_obj.success != undefined && hash_res_obj.success != "")
            {
                try{
                    var _dialogIns = btn.getParent('.dialog').retrieve('instance');
                }catch(e){}
                
                if(_dialogIns)
                {    
                    _dialogIns.close();
                    window.finderGroup['<{$env.get._finder.finder_id}>'].refresh();
                }
            }
            
        }
    });

        btn.addEvent('click',function(){
        
            _form.fireEvent('submit',{stop:$empty});
            
        
        
        });
    
})();

</script>
